package com.meihua.code.leader.domain;

import com.meihua.code.leader.RaftNode;

import java.io.Serializable;

/**
 * @program: code
 * @description:
 * @author: meihua
 * @created: 2021/08/10 15:36
 */
public class HttpRequest<T> implements Serializable {
    private String url;
    private RaftNode node;
    private T body;
    private int term;
    private int logIndex;

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public T getBody() {
        return body;
    }

    public void setBody(T body) {
        this.body = body;
    }

    public RaftNode getNode() {
        return node;
    }

    public void setNode(RaftNode node) {
        this.node = node;
    }

    public int getTerm() {
        return term;
    }

    public void setTerm(int term) {
        this.term = term;
    }



    public HttpRequest() {
    }

    public int getLogIndex() {
        return logIndex;
    }

    public void setLogIndex(int logIndex) {
        this.logIndex = logIndex;
    }

    public HttpRequest(String url, RaftNode node, T body, int term, int logIndex) {
        this.url = url;
        this.node = node;
        this.body = body;
        this.term = term;
        this.logIndex = logIndex;
    }

    @Override
    public String toString() {
        return "HttpRequest{" +
                "url='" + url + '\'' +
                ", node=" + node +
                ", body='" + body + '\'' +
                ", term=" + term +
                ", logIndex=" + logIndex +
                '}';
    }
}
